package org.javaboy.vhr.service;

import org.javaboy.vhr.mapper.LeaveApplicationMapper;
import org.javaboy.vhr.model.LeaveApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LeaveApplicationService {
    @Autowired
    private LeaveApplicationMapper leaveApplicationMapper;

   public int file(LeaveApplication leaveApplication){
       return leaveApplicationMapper.file(leaveApplication);
   }


    public int addLeaveApplication(LeaveApplication leaveApplication) {
        return leaveApplicationMapper.addLeaveApplication(leaveApplication);
    }

    public List<LeaveApplication> selectAll() {
        return leaveApplicationMapper.selectAll();
    }

    public List<LeaveApplication> getLeaveApplicationsByEmployeeId(Integer employeeId) {
        return leaveApplicationMapper.getLeaveApplicationsByEmployeeId(employeeId);
    }


    public int approveLeaveApplication(LeaveApplication leaveApplication) {
        return leaveApplicationMapper.approveLeaveApplication(leaveApplication);
    }
}
